{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "08182b35-a33f-40f3-96a8-e4b161e6b7fb",
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "import random\n",
    "import shutil"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "5109f858-2c15-4a7b-81b7-6d101834ebe2",
   "metadata": {},
   "outputs": [],
   "source": [
    "create_txt = \"test.txt\"\n",
    "maned_txt = \"data_sort/test/label.txt\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "17d04eda-ba73-4e08-8326-fbf810de6f5a",
   "metadata": {},
   "outputs": [],
   "source": [
    "create_dic = {}\n",
    "with open(create_txt, 'r') as f:\n",
    "    lines = f.readlines()\n",
    "    for line in lines:\n",
    "        line = line.split('/')[-1]\n",
    "        k_v = line.split(' ')\n",
    "        create_dic[k_v[0]] = k_v[1]\n",
    "    f.close()\n",
    "\n",
    "maned_dic = {}\n",
    "with open(maned_txt, 'r') as f:\n",
    "    lines = f.readlines()\n",
    "    for line in lines:\n",
    "        line = line.split('/')[-1]\n",
    "        k_v = line.split(' ')\n",
    "        maned_dic[k_v[0]] = k_v[1]\n",
    "    f.close()\n",
    "\n",
    "with open('correct.txt', 'w') as f:\n",
    "    for k, v in create_dic.items():\n",
    "        if k not in maned_dic or maned_dic[k] != v:\n",
    "            f.write(k + ' ' + v)\n",
    "    f.close()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
